---
id: 65687e457ab1c4cb8c3fe7c8
title: Крок 33
challengeType: 20
dashedName: step-33
---

# --description--

Налаштуйте виклик `verify_card_number` так, щоб при поверненні `True` на консолі було `'VALID!'`. А в іншому випадку — `'INVALID!'`.

# --hints--

Функція `main` повинна містити `if verify_card_number(translated_card_number):`.

```js
({
    test: () => {
        const transformedCode = code.replace(/\r/g, "");
        const main = __helpers.python.getDef("\n" + transformedCode, "main");
        const { function_body } = main;

        const if_statement = __helpers.python.getBlock("\n" + function_body, "if verify_card_number(translated_card_number)");
        assert.exists(if_statement);
    }
})
```

Інструкція `if` повинна містити `print('VALID!')`.

```js
({
    test: () => {
        const transformedCode = code.replace(/\r/g, "");
        const if_statement = __helpers.python.getBlock("\n" + transformedCode, "if verify_card_number(translated_card_number)");
        const {block_body} = if_statement;

        assert.match(block_body, /print\(\s*('|")VALID!\1\s*\)/);
    }
})
```

Умова `else` повинна містити `print('INVALID!')`.

```js
({
    test: () => {
        const transformedCode = code.replace(/\r/g, "");
        const else_statement = __helpers.python.getBlock("\n" + transformedCode, "else");
        const {block_body} = else_statement;

        assert.match(block_body, /print\(\s*('|")INVALID!\1\s*\)/);
    }
})
```

# --seed--

## --seed-contents--

```py
def verify_card_number(card_number):
    sum_of_odd_digits = 0
    card_number_reversed = card_number[::-1]
    odd_digits = card_number_reversed[::2]

    for digit in odd_digits:
        sum_of_odd_digits += int(digit)

    sum_of_even_digits = 0
    even_digits = card_number_reversed[1::2]
    for digit in even_digits:
        number = int(digit) * 2
        if number >= 10:
            number = (number // 10) + (number % 10)
        sum_of_even_digits += number
    total = sum_of_odd_digits + sum_of_even_digits
    print(total)
    return total % 10 == 0
--fcc-editable-region--
def main():
    card_number = '4111-1111-4555-1142'
    card_translation = str.maketrans({'-': '', ' ': ''})
    translated_card_number = card_number.translate(card_translation)

    verify_card_number(translated_card_number)
--fcc-editable-region--

main()
```
